/* picker 数据选择 */
$picker: (
  'height': getCssVar(editor, default, line-height),
  'empty-bg-color': getCssVar(color, bg, 3),
);

@include b('picker') {
  .el-input .el-input__inner {
    font-size: getCssVar('form-item', 'font-size');
    color: getCssVar('form-item', 'text-color');
    border-color: getCssVar('form-item', 'border-color');
  }

  .el-input .el-input__inner::placeholder {
    color: getCssVar('form-item', 'placeholder-color');
  }

  .el-input.is-disabled .el-input__inner {
    color: getCssVar('form-item', 'disabled-color');
    border-color: getCssVar('form-item', 'disabled-border-color');
  }

  ion-icon {
    font-size: getCssVar(form-item, font-size);
    cursor: pointer;
  }

  @include b(picker-input) {
    width: 100%;

    .el-input__wrapper{
      width: 100%;
    }
  }

  @include e('buns-position') {
    position: relative;
    display: inline-block;
  }

  @include e('btns') {
    position: absolute;
    right: 0;
    @include flex;

    height: getCssVar('picker', 'height');

    span {
      @include flex($direction: column, $horizontal: center);
    }
  }

  @include e('autocomplete') {
    @include flex;

    .el-autocomplete {
      width: 100%;
    }
  }

  @include e('transfer-item') {
    padding: getCssVar('spacing', 'extra-tight');
    cursor: pointer;

    &:hover {
      background-color: getCssVar('form-item', 'hover-bg-color');
    }
  }

  @include e('link') {
    width: getCssVar('font-size', 'header-1');
    height: getCssVar('font-size', 'header-1');
    padding: 0 getCssVar('spacing', 'tight');
    font-size: getCssVar('font-size', 'header-6');
  }

  @include m(disabled) {
    ion-icon {
      pointer-events: none;
    }
  }

  @include m(readonly) {
    font-size: getCssVar(form-item, font-size);
    line-height: getCssVar(editor, default, line-height);
    color: getCssVar('form-item', 'readonly-color');
  }
}

@include b('picker') {
  @include e('transfer-item') {
    @include when(ellipsis) {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  // 界面行为项
  @include e(action-item) {
    display: flex;
    align-items: center;
    justify-content: center;
    color: getCssVar(color, link);
    @include m(caption) {
      margin-left: getCssVar(spacing, extra-tight);
    }
    @include when(disabled) {
      color: getCssVar(color, disabled-text);
      cursor: not-allowed;
    }
  }

  @include e(empty) {
    padding: 0;
    #{getCssVarName(no-data, min-height)}: 100px;

    --el-empty-image-width: 100px;
  }

  @include e(transfer) {
    @include set-component-css-var('picker', $picker);
    @include when(empty) {
      .el-autocomplete-suggestion li {
        padding: 0;
      }
      .#{bem(no-data)} {
        background-color: getCssVar(picker, empty-bg-color);
      }
    }
  }

  @include e(suffix) {
    cursor: pointer;
    visibility: inherit;
    transition: var(--el-transition-duration);
    transform: rotate(0);
    @include when(reverse) {
      transform: rotate(-180deg);
    }
  }
}

// 表单下的编辑器默认显示，悬浮上去显示编辑器
@include b(picker-form-default-content){
  display: none;
}

@include b(form-item){

  @include b(picker) {
    @include when(show-default){
      // 悬浮显示编辑器
      &:hover{
        @include b(picker-form-default-content){
          display: none;
        }     
        @include b(picker-input){
          display: block;    
        }       
      }    
      
      // 不悬浮时显示信息态
      @include b(picker-form-default-content){      
        display: flex;
        align-items: center;
        width: 100%;
        padding: getCssVar(form-item, hover-edit-padding);        
        font-family: Arial, sans-serif;;      
        font-size: getCssVar(form-item, font-size);
        line-height: getCssVar(editor, default, line-height);
        color: getCssVar(form-item, text-color);            
      }
      @include b(picker-input){
        display: none;  
      }
      
      // 输入态
      @include when(editable){
        @include b(picker-form-default-content){
          display: none;
        }     
        @include b(picker-input){
          display: block;    
        }  
      }
    }

  }
}